--- import { type CollectionEntry, getCollection } from "astro:content"; import Comments from "../../components/Comments.astro"; import Layout from "../../layouts/BaseLayout.astro"; import dayjs from "dayjs"; type Props = CollectionEntry<"blog">; export async function getStaticPaths() { const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; }); return posts.map((post) => ({ params: { slug: post.slug }, props: post, })); } const post = Astro.props; const { Content, remarkPluginFrontmatter } = await post.render(); const date = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); const title = `${post.data.title} | Valentin Popov`; const description = post.data.description; const lang = post.data.lang; --- {post.data.title} Posted {date} by {post.data.author} • {remarkPluginFrontmatter.minutesRead}
Posted {date} by {post.data.author} • {remarkPluginFrontmatter.minutesRead}